<template>
  <page-header-wrapper>
    <!-- <template v-slot:content>
      <div class="page-header-content">
        
      </div>
    </template>
    <template v-slot:extraContent>
      <div>
      	
      </div>
    </template> -->
    <a-card>
      <dw-button :dwButtons="dwButtons"></dw-button>
      <dw-table ref="dwTable" :columns="columns" :tableButtons="tableButtons">
      </dw-table>
    </a-card>
    <table-edit ref="edit" @handle="reload"></table-edit>
    <reset-pwd ref="resetPwd"></reset-pwd>
  </page-header-wrapper>
</template>

<script>
import { BaseMixin } from 'daowey-vueweb'; 
import TableEdit from './edit'
import ResetPwd from './resetPwd'
export default {
  name: 'User',
  mixins:[ BaseMixin ],
  components: {
    TableEdit,
    ResetPwd
  },
  data () {
    return {
      tableCode:'User',
      queryFields:['userStatus', 'name', 'userName', 'phone', 'isAdmin'],
      tableFields:['userStatus', 'name', 'userName', 'phone', 'isAdmin'],
      action:['create','edit','delete','resetPwd'],
      row:{}
    }
  },
  computed: {
    userInfo () {
      return this.$store.getters.userInfo
    }
  },
  created () {
    console.log(this.$dw)
    this.addTableButton({
      label:'重置密码',
      code:'resetPwd',
      action:row=>{
        this.resetPwd(row);
      }
    })
  },
  mounted () {

  },
  methods: {
    treeClick(ev){
      this.queryParams = {depId:(ev||1)}
      this.reload();
    },
    resetPwd(row){
      this.$refs.resetPwd.open(row);
    }
  }
}
</script>

<style lang="less" scoped>

</style>
